//
//  MineViewCtr.swift
//  SwiftStory
//
//  Created by ZxjMacBookPro on 2020/4/13.
//  Copyright © 2020 ZxjMacBookPro. All rights reserved.
//

import UIKit

class MineViewCtr: BaseViewCtr {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        //判断用户登录
        if !isLogin {
            visitorView?.setupVisitorInfo(imageName: "visitordiscover_image_profile", title: "登录后，你的微博、相册、个人资料会显示在这里，展示给别人")
        }
        
        setupNav()
        // Do any additional setup after loading the view.
    }
    
    private func setupNav(){
        let rightBtn = UIButton()
        rightBtn.setImage(UIImage(named: "navigationbar_pop"), for: .normal)
        rightBtn.addTarget(self, action: #selector(rightBtnClick), for: .touchUpInside)
        rightBtn.sizeToFit()
        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: rightBtn)
        
    }

    @objc private func rightBtnClick(){
        let vc = QRCodeViewCtr()
        vc.hidesBottomBarWhenPushed = true
        navigationController?.pushViewController(vc, animated: true)
    }
}
